package de.breitbeil.jbooking.ui.form;

import org.springframework.binding.form.FormModel;
import org.springframework.richclient.settings.Settings;

import de.breitbeil.jbooking.ui.preferences.SettingsFormObject;

public class ExportFormObject implements SettingsFormObject {

    private String output;

    public void setOutput(String output) {
        this.output = output;
    }
    public String getOutput() {
        return output;
    }
    
    public void fillDefaults(FormModel formModel) {
        StringBuilder defaultOutput = new StringBuilder();
        defaultOutput.append(System.getProperty("user.home"));
        defaultOutput.append(System.getProperty("file.separator"));
        defaultOutput.append("JBooking.zip");
        
        formModel.getValueModel("output").setValue(defaultOutput.toString());
        
    }
    public void init(Settings settings) {
        output = settings.getString("export.output");
    }
    public void save(Settings settings) {
        settings.setString("export.output", output);
    }
    
}
